<template>
	<nav>
		<ul class="nav">
			<!-- <router-link tag="li" :to="{path:navli.path,query:{empNo:personalId}}" :class="{cur:navli.isCur}" v-for="(navli,index) of navList" @click="navLiTab(navli)">{{navli.name}}</router-link> -->
			<!-- <li :class="{cur:navli.isCur}" v-for="(navli,index) of navList" @click="navLiTab(navli)">{{navli.name}}</li> -->
			<li v-for="(navli,index) of navList" :class="{cur:navli.iscur}" @click="navLiTab(navli,index)">{{navli.name}}</li>
		</ul>
	</nav>
</template>
<script type="text/javascript">
	import getInterface from '../../assets/js/insterface'

	export default{
		data(){
			return{

				'personalId':this.$route.query.empNo,
				'navList':[
					{
						'name':'周',
						'iscur':true,
						'path':'/S_Performance-week'
					},
					{
						'name':'年',
						'iscur':false,
						'path':'/S_Performance-year'
					},
					{
						'name':'团队',
						'iscur':false,
						'path':'/S_Performance-team'
					}

				],
				/*navList:[
				 	{'name':'周', 'isCur':true, 'isSHow':true, 'path':'/S_Performance-week'},
				 	{'name':'年', 'isCur':false, 'isSHow':true, 'path':'/S_Performance-year'},
				 	{'name':'团队', 'isCur':false, 'isSHow':true, 'path':'/S_Performance-team'}
				],*/
				'jurisdictionUrl':getInterface.getJurisdictionUrl + '' + this.$route.query.empNo,
			}
		},
		mounted(){
			//this.$router.push({path:'/S_Performance-week',query:{empNo:this.personalId}});
			this.navShow();


		},
		methods:{
			navLiTab(navli,index){
				console.log(navli.name)

				/*if(navli.name == '周'){
					this.$router.push({path:'/S_Performance-week',query:{empNo:this.personalId}})
					for(let i=0; i<this.navList.length;i++){
						this.navList[i].iscur = false;
					};
					navli.iscur = true;
				}*/

				switch(navli.name){
					case '周':
						this.$router.push({path:'/S_Performance-week',query:{empNo:this.personalId}});
						for(let i=0; i<this.navList.length;i++){
							this.navList[i].iscur = false;
						};
						navli.iscur = true;
						break;
					case '年':
						this.$router.push({path:'/S_Performance-year',query:{empNo:this.personalId}});
						for(let i=0; i<this.navList.length;i++){
							this.navList[i].iscur = false;
						};
						navli.iscur = true;
						break;
					case '团队':
						this.$router.push({path:'/S_Performance-team',query:{empNo:this.personalId}});
						for(let i=0; i<this.navList.length;i++){
							this.navList[i].iscur = false;
						};
						navli.iscur = true;
						break;
				}
				// this.$router.push({path:navli.path,query:{empNo:this.personalId}})

				/*if(index == 0){
					this.isTeamShow = true;
					this.isCountryShow = false;
				}else if(index == 1){
					this.isTeamShow = false;
					this.isCountryShow = true;
				}*/
			},
			navShow(){
				this.$http.get(this.jurisdictionUrl,{emulateJSON:true})
				.then((response) => {
					console.log(response)
				})

			}
		}
	}
</script>